package com.cuitrip.business.tripservice.ui;

import android.content.Context;
import android.view.View;

import com.cuitrip.business.tripservice.model.FavInfo;
import com.cuitrip.service.R;
import com.lab.adapter.BaseHolderView;
import com.lab.adapter.IAdapterData;
import com.lab.utils.ImageHelper;

import butterknife.ButterKnife;
import butterknife.Bind;
import de.hdodenhof.circleimageview.CircleImageView;


/**
 * 圆形图片
 *
 * @author ak
 */
public class CircleLogoHolderView extends BaseHolderView {

    @Bind(R.id.logo)
    CircleImageView logo;

    public CircleLogoHolderView(Context context) {
        super(context, R.layout.item_circle_image_view);
    }

    @Override
    public void initView(View rootView) {
        ButterKnife.bind(this);
    }

    @Override
    public void bindData(IAdapterData data, int position) {
        if (data instanceof FavInfo.FavUserInfo){
            FavInfo.FavUserInfo favUserInfo = (FavInfo.FavUserInfo) data;
            ImageHelper.displayPersonImage(favUserInfo.getLikerPic(), logo, null);
        }
    }
}
